﻿using FreeOPC.Config;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FreeOPC.Server.Window
{
    public class Worker : BackgroundService
    {

        public Worker()
        {

        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            try
            {
                SerilogServer.WriteLog("OPCClientWindows", new string[] { "ExecuteAsync" });
            }
            catch (Exception e)
            {
            }
        }

        public override Task StartAsync(CancellationToken cancellationToken)
        {
            SerilogServer.WriteLog("OPCClientWindows", new string[] { "服务开始了" });
            return base.StartAsync(cancellationToken);
        }
        public override Task StopAsync(CancellationToken cancellationToken)
        {
            SerilogServer.WriteLog("OPCClientWindows", new string[] { "服务结束了" });

            return base.StopAsync(cancellationToken);
        }

    }
}
